#include<bits/stdc++.h>
using namespace std;
#define int long long

int fun(int n, int m, vector<int> nums) {
	priority_queue<int> q;
	for (int i : nums)
		q.push(i);

	while (m--) {
		int t = q.top();
		q.pop();
		t /= 2;
		q.push(t);
	}

	int ans = 0;
	while (!q.empty()) {
		ans += q.top();
		q.pop();
	}
	return ans;
}

signed main() {
	int n, m;
	cin >> n >> m;
	vector<int> nums(n);
	for (int i = 1; i <= n; i++)
		cin >> nums[i - 1];
	cout << fun(n, m, nums);
	return 0;
}
